package edu.sias.question.utils;

import edu.sias.question.domain.dto.QuestionDTO;
import edu.sias.question.domain.pojo.Question;
import org.springframework.stereotype.Component;

/**
 * 把前端传的参数转成es需要的参数
 */
@Component
public class EsCopy {
    public static void copy(QuestionDTO questionDTO, Question question){
        questionDTO.setId(String.valueOf( question.getId()));
        questionDTO.setType(String.valueOf(question.getQuestionType()));
        questionDTO.setContent(question.getContent());
        questionDTO.setScore(question.getDifficulty());
//        questionDTO.setTags(question.getTags());
        questionDTO.setOptions(question.getOptions());
        questionDTO.setCorrectAnswers(question.getCorrectAnswers());
    }
}
